package com.taobao.txc.common.c;

import io.netty.buffer.ByteBuf;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

public class f
  extends F
  implements Serializable
{
  String a;
  List<Long> b = new ArrayList();
  List<Long> c = new ArrayList();
  String d;
  String e;
  String f;
  byte g;
  String h = null;
  public ByteBuffer i;
  
  public f()
  {
    this(1024);
  }
  
  public f(int paramInt)
  {
    this.i = ByteBuffer.allocate(paramInt);
  }
  
  public String b()
  {
    return this.f;
  }
  
  public void a(String paramString)
  {
    this.f = paramString;
  }
  
  public String d()
  {
    return this.h;
  }
  
  public void b(String paramString)
  {
    this.h = paramString;
  }
  
  public void c(String paramString)
  {
    this.d = paramString;
  }
  
  public String e()
  {
    return this.e;
  }
  
  public void d(String paramString)
  {
    this.e = paramString;
  }
  
  public List<Long> f()
  {
    return this.b;
  }
  
  public List<Long> g()
  {
    return this.c;
  }
  
  public byte h()
  {
    return this.g;
  }
  
  public String i()
  {
    return this.a;
  }
  
  public void e(String paramString)
  {
    this.a = paramString;
  }
  
  public String toString()
  {
    return a(false);
  }
  
  public String a(boolean paramBoolean)
  {
    StringBuilder localStringBuilder = new StringBuilder("BranchCommitMessage ");
    if (paramBoolean) {
      for (int j = 0; j < this.b.size(); j++) {
        localStringBuilder.append(this.c.get(j)).append("\t");
      }
    } else if (this.c.size() > 0) {
      localStringBuilder.append(this.c.get(0)).append("...");
    }
    localStringBuilder.append(",size:").append(this.b.size()).append(" DBname:").append(this.e).append(",appName:").append(this.d).append(",commitMode:").append(this.g).append(",udata:").append(this.h).append(",rtsql:").append(this.f).toString();
    return localStringBuilder.toString();
  }
  
  public short b_()
  {
    return 3;
  }
  
  public byte[] c()
  {
    if (this.b.size() > 32)
    {
      j = this.b.size();
      j = j / 64 + 2;
      this.i = ByteBuffer.allocate(j * 1024);
    }
    this.i.putInt(this.b.size());
    for (int j = 0; j < this.b.size(); j++)
    {
      this.i.putLong(((Long)this.b.get(j)).longValue());
      this.i.putLong(((Long)this.c.get(j)).longValue());
    }
    this.i.put(this.g);
    if (this.a != null)
    {
      arrayOfByte = this.a.getBytes(j);
      this.i.putShort((short)arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.i.put(arrayOfByte);
      }
    }
    else
    {
      this.i.putShort((short)0);
    }
    if (this.d != null)
    {
      arrayOfByte = this.d.getBytes(j);
      this.i.putShort((short)arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.i.put(arrayOfByte);
      }
    }
    else
    {
      this.i.putShort((short)0);
    }
    if (this.e != null)
    {
      arrayOfByte = this.e.getBytes(j);
      this.i.putShort((short)arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.i.put(arrayOfByte);
      }
    }
    else
    {
      this.i.putShort((short)0);
    }
    if (this.h != null)
    {
      arrayOfByte = this.h.getBytes(j);
      this.i.putShort((short)arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.i.put(arrayOfByte);
      }
    }
    else
    {
      this.i.putShort((short)0);
    }
    if (this.f != null)
    {
      arrayOfByte = this.f.getBytes(j);
      this.i.putShort((short)arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.i.put(arrayOfByte);
      }
    }
    else
    {
      this.i.putShort((short)0);
    }
    this.i.flip();
    byte[] arrayOfByte = new byte[this.i.limit()];
    this.i.get(arrayOfByte);
    return arrayOfByte;
  }
  
  public boolean a(ByteBuf paramByteBuf)
  {
    int j = paramByteBuf.readableBytes();
    if (j < 15) {
      return false;
    }
    j -= 15;
    int k = paramByteBuf.readInt();
    if (j < 16 * k) {
      return false;
    }
    j -= 16 * k;
    for (int m = 0; m < k; m++)
    {
      this.b.add(Long.valueOf(paramByteBuf.readLong()));
      this.c.add(Long.valueOf(paramByteBuf.readLong()));
    }
    this.g = paramByteBuf.readByte();
    m = paramByteBuf.readShort();
    byte[] arrayOfByte;
    if (m > 0)
    {
      if (j < m) {
        return false;
      }
      j -= m;
      arrayOfByte = new byte[m];
      paramByteBuf.readBytes(arrayOfByte);
      e(new String(arrayOfByte, j));
    }
    m = paramByteBuf.readShort();
    if (m > 0)
    {
      if (j < m) {
        return false;
      }
      j -= m;
      arrayOfByte = new byte[m];
      paramByteBuf.readBytes(arrayOfByte);
      c(new String(arrayOfByte, j));
    }
    m = paramByteBuf.readShort();
    if (m > 0)
    {
      if (j < m) {
        return false;
      }
      j -= m;
      arrayOfByte = new byte[m];
      paramByteBuf.readBytes(arrayOfByte);
      d(new String(arrayOfByte, j));
    }
    m = paramByteBuf.readShort();
    if (m > 0)
    {
      if (j < m) {
        return false;
      }
      j -= m;
      arrayOfByte = new byte[m];
      paramByteBuf.readBytes(arrayOfByte);
      b(new String(arrayOfByte, j));
    }
    m = paramByteBuf.readShort();
    if (m > 0)
    {
      if (j < m) {
        return false;
      }
      j -= m;
      arrayOfByte = new byte[m];
      paramByteBuf.readBytes(arrayOfByte);
      a(new String(arrayOfByte, j));
    }
    return true;
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.c.f
 * JD-Core Version:    0.7.0.1
 */